/*
 * Linux IEEE 802.15.4 6lowpan daemon
 *
 * Copyright (C) 2010 HIIT
 *
 * Written-by: Dmitry Kuptsov
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; version 2 of the License.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License along
 *  with this program; if not, write to the Free Software Foundation, Inc.,
 *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */
 
#include "6lowpand.h"

#define TRUE 1 
#define FALSE 0

int main(int argc, char **argv) {
	int router_mode = FALSE;

	if (argv[1] && !strcmp(argv[1], "--version")) {
		printf(	"6lowpan daemon " VERSION "\n"
			"Copyright (C) 2010 by HIIT, ESPOO, FINLAND\n"
			"License GPLv2 GNU GPL version 2 <http://gnu.org/licenses/gpl.html>.\n"
			"This is free software: you are free to change and redistribute it.\n"
			"There is NO WARRANTY, to the extent permitted by law.\n"
			"\n"
			"Written by Dmitry Kuptsov\n");
		return 0;
	}

	if (!argv[1] || !strcmp(argv[1], "--help") || argc != 4) {
		printf("Usage: %s \n", argv[0]);
		printf("  or:  %s --version --edge-router-mode\n", argv[0]);
		printf("\n\n \t --version \t Print software version \n");
		printf("\n\n \t --edge-router-mode \t Run the daemon as a edge router connecting WSN and Internet \n");
		return 0;
	}
	
	if (argv[1] && !strcmp(argv[1], "--edge-router-mode")) {
		router_mode = TRUE;
	}

	return protocol_loop(router_mode);
}
